#ifndef _ENCODE_H
#define _ENCODE_H

#include <REGF51RC.H>
#include "type.h"

#define encodePin P1
#define encodePin1 0x40
#define encodePin2 0x80

typedef struct _ENCODE
{
    uint8_t pin;
    int16_t count;
} ENCODE;

void encodeInit(void);
int16_t encodeRead(uint8_t ch);
int16_t encodeReadErase(uint8_t ch);
void encodeTrigger(uint8_t ch);

#endif
